﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SettingReplyLBSCreate.aspx.cs" ValidateRequest="false" Inherits="bianzhuo.SupportPlatform.WebUI.BzBusiness.SettingReplyLBSCreate" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/msg_css.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script src="ckfinder/ckfinder.js" type="text/javascript"></script>
    <script src="js/UpLoadImgByFinder.js" type="text/javascript"></script>
    <script src="js/msg_js.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="content">
        <ul class="breadcrumb"> 
     <li><div class="tem_img tem_l" title="关闭左侧菜单" id="closeleftframe" onclick="parent.document.getElementsByTagName('frameset')[1].cols = '0,*'; $('#closeleftframe').hide(); $('#openleftframe').show();"></div><div class="tem_img tem_r" title="展开左侧菜单"  id="openleftframe" onclick="parent.document.getElementsByTagName('frameset')[1].cols = '240,*';$('#closeleftframe').show();$('#openleftframe').hide();"></div></li>  
            <li><a href="#">首页</a> <span class="divider">/</span></li>
            <li class="active">添加LBS回复</li>
        </ul>
        
        <div class="container">
         <div class="user_msg">
             <div class="user_msg_l2">
          <div  class="re_form">
        	<table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                  	<th><span class="biaoji">*</span>关键词：</th>
                    <td>
                        <asp:TextBox  class="input_text" ID="txtKeyWord" runat="server"></asp:TextBox><span class="tips">多个关键词请用|格开：例如: 九仟CMS|九仟</span></td>
                  </tr>
                  <tr>
                  	<th><span class="biaoji">*</span>标题：</th>
                    <td><asp:TextBox class="input_text" ID="txtTitle" runat="server"></asp:TextBox></td>
                  </tr>
                  <tr>
                  	<th><span class="biaoji">*</span>图片：</th>
                    <td><input runat="server" type="hidden" id="TxtPictures" />
                        <div class="onepic"></div><span class="tips">大小: 不超过300k.   </span></td>
                  </tr>
                <tr>
                  	<th><span class="biaoji">*</span>地址：</th>
                    <td><asp:TextBox class="input_text" ID="txtDescription" Width="400" runat="server"></asp:TextBox>
                        </td>
                  </tr>
                  <tr>
                  	<th valign="top"><span class="biaoji">*</span>地图标记：</th>
                    <td>
                        <div id="l-map"  style="width:605px; height:320px;">
                  
                  
</div>
<div id="r-result">
    <asp:TextBox ID="lng" Text="120.88888" ClientIDMode="Static" runat="server"></asp:TextBox>
    <asp:TextBox ID="lat" Text="30.3416830000" ClientIDMode="Static" runat="server"></asp:TextBox>    
    <input  type="hidden"  name="city" class="px" id="city" size="20" value=""/> 

</div>
                        
                        <script src="http://api.map.baidu.com/api?key=a258befb5804cb80bed5338c74dd1fd1&v=1.1&services=true" type="text/javascript" type="text/javascript" ></script><script type="text/javascript">
         var map = new BMap.Map("l-map");
         var myGeo = new BMap.Geocoder();
         //map.addControl(new BMap.MapTypeControl({mapTypes: [BMAP_NORMAL_MAP,BMAP_HYBRID_MAP]}));     //2D图，卫星图

         //map.addControl(new BMap.MapTypeControl({anchor: BMAP_ANCHOR_TOP_LEFT}));    //左上角，默认地图控件

         //alert(city);
         var currentPoint;
         var marker1;
         var marker2;
         map.enableScrollWheelZoom();
         //var point = new BMap.Point(116.331398,39.897445);  

         map.enableDragging();
         map.enableContinuousZoom();
         map.addControl(new BMap.NavigationControl());
         map.addControl(new BMap.ScaleControl());
         map.addControl(new BMap.OverviewMapControl());
         var point = new BMap.Point(120.1215850000, 30.3416830000);
         marker1 = new BMap.Marker(point);        // 创建标注
         map.addOverlay(marker1);
         var opts = {
             width: 220,     // 信息窗口宽度 220-730
             height: 60,     // 信息窗口高度 60-650
             title: ""  // 信息窗口标题
         }
         var infoWindow = new BMap.InfoWindow("原本位置 九仟CMS九仟信息技术公司 ,移动红点修改位置!你也可以直接修改上方位置系统自动定位!", opts);  // 创建信息窗口对象
         marker1.openInfoWindow(infoWindow);      // 打开信息窗口
         doit(point);

         function auto() {
             var geolocation = new BMap.Geolocation();
             geolocation.getCurrentPosition(function (r) {
                 if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                     //var mk = new BMap.Marker(r.point);  
                     //map.addOverlay(mk);  
                     // point = r.point;  
                     //map.panTo(r.point); 

                     var point = new BMap.Point(r.point.lng, r.point.lat);
                     marker1 = new BMap.Marker(point);        // 创建标注
                     map.addOverlay(marker1);
                     var opts = {
                         width: 220,     // 信息窗口宽度 220-730
                         height: 60,     // 信息窗口高度 60-650
                         title: ""  // 信息窗口标题
                     }
                     var infoWindow = new BMap.InfoWindow("定位成功这是你当前的位置!,移动红点标注目标位置，你也可以直接修改上方位置,系统自动定位!", opts);  // 创建信息窗口对象
                     marker1.openInfoWindow(infoWindow);      // 打开信息窗口
                     doit(point);

                 } else {

                 }
             })
         }
         function doit(point) {
             //map.centerAndZoom(point,12);  
             
             //myGeo.getPoint(city, function(point){ 
             if (point) {
                 //window.external.setlngandlat(point.lng,point.lat);
                 //alert(point.lng + "  ddd " + point.lat);

                 document.getElementById('lat').value = point.lat;
                 document.getElementById('lng').value = point.lng;
                 map.setCenter(point);
                 map.centerAndZoom(point, 15);
                 map.panTo(point);

                 var cp = map.getCenter();
                 myGeo.getLocation(point, function (result) {
                     if (result) {
                         document.getElementById('suggestId').value = result.address;
                     }
                 });

                 marker2 = new BMap.Marker(point);        // 创建标注  
                 var opts = {
                     width: 220,     // 信息窗口宽度 220-730
                     height: 60,     // 信息窗口高度 60-650
                     title: ""  // 信息窗口标题
                 }
                 var infoWindow = new BMap.InfoWindow("拖拽地图或红点，在地图上用红点标注您的店铺位置。", opts);  // 创建信息窗口对象
                 marker2.openInfoWindow(infoWindow);      // 打开信息窗口

                 map.addOverlay(marker2);                     // 将标注添加到地图中

                 marker2.enableDragging();
                 marker2.addEventListener("dragend", function (e) {
                     document.getElementById('lat').value = e.point.lat;
                     document.getElementById('lng').value = e.point.lng;
                     myGeo.getLocation(new BMap.Point(e.point.lng, e.point.lat), function (result) {
                         if (result) {
                             $('suggestId').value = result.address;
                             //$('city').value = result.city;
                             //			alert(result.address)				
                             //	window.external.setaddress(result.address);//setarrea(result.address);//
                             //marker1.setPoint(new BMap.Point(e.point.lng,e.point.lat));        // 移动标注
                             marker2.setPoint(new BMap.Point(e.point.lng, e.point.lat));
                             map.panTo(new BMap.Point(e.point.lng, e.point.lat));
                             //window.external.setlngandlat(e.point.lng,e.point.lat);
                         }
                     });
                 });

                 map.addEventListener("dragend", function showInfo() {
                     var cp = map.getCenter();
                     myGeo.getLocation(new BMap.Point(cp.lng, cp.lat), function (result) {
                         if (result) {
                             document.getElementById('suggestId').value = result.address;
                             document.getElementById('lat').value = cp.lat;
                             document.getElementById('lng').value = cp.lng;
                             //	window.external.setaddress(result.address);//setarrea(result.address);//
                             //alert(point.lng + "  ddd " + point.lat);
                             //marker1.setPoint(new BMap.Point(cp.lng,cp.lat));        // 移动标注
                             marker2.setPoint(new BMap.Point(cp.lng, cp.lat));
                             map.panTo(new BMap.Point(cp.lng, cp.lat));
                             //window.external.setlngandlat(cp.lng,cp.lat);
                         }
                     });
                 });

                 map.addEventListener("dragging", function showInfo() {
                     var cp = map.getCenter();
                     //marker1.setPoint(new BMap.Point(cp.lng,cp.lat));        // 移动标注
                     marker2.setPoint(new BMap.Point(cp.lng, cp.lat));
                     map.panTo(new BMap.Point(cp.lng, cp.lat));
                     map.centerAndZoom(marker2.getPoint(), map.getZoom());
                 });
                 
             }

             //}, province);
         }

         function loadmap() {
             var province = document.getElementById('city').value;
             var city = document.getElementById('suggestId').value;
             // 将结果显示在地图上，并调整地图视野  
             myGeo.getPoint(city, function (point) {
                 if (point) {
                     //marker1.setPoint(new BMap.Point(point.lng,point.lat));        // 移动标注
                     marker2.setPoint(new BMap.Point(point.lng, point.lat));
                     //window.external.setlngandlat(marker2.getPoint().lng,marker2.getPoint().lat);
                     //alert(point.lng + "  ddd " + point.lat);
                     document.getElementById('lat').value = point.lat;
                     document.getElementById('lng').value = point.lng;
                     map.panTo(new BMap.Point(marker2.getPoint().lng, marker2.getPoint().lat));
                     map.centerAndZoom(marker2.getPoint(), map.getZoom());
                 } 
             }, province);
         }

         function setarrea(address, city) {
             $('suggestId').value = address;
             //$('city').value=city;
             window.setTimeout(function () {
                 loadmap();
             }, 2000);
         }

         function initarreawithpoint(lng, lat) {
             window.setTimeout(function () {
                 //marker1.setPoint(new BMap.Point(lng,lat));        // 移动标注
                 marker2.setPoint(new BMap.Point(lng, lat));
                 //window.external.setlngandlat(lng,lat);
                 map.panTo(new BMap.Point(lng, lat));
                 map.centerAndZoom(marker2.getPoint(), map.getZoom());
             }, 2000);
         }

         </script>
                        
                        </td>
                  </tr>
                  
                  <tr>
                  	<th></th>
                    <td>
                        <asp:Button ID="saveButton1" class="btn btn-01" Text="保 存" runat="server" 
                            onclick="saveButton1_Click" /></td>
                  </tr>
               </table>
         </div>
           </div>
              <div class="user_msg_r">
              <div class="user_mrtop">自定义回复</div>
              <div class="user_listdet">
                  <ul>
                      <li class="user_libg_02"><a href="SettingReplyAuto.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">关注默认回复</a></li>
                      <li class="user_libg_01"><a href="SettingReplyDefault.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">文本回复</a></li>
                      <li class="user_libg_03"><a href="SettingReplyPictrue.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">图文回复</a></li>
                      <li class="user_libg_04"><a href="SettingReplyAudio.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">语音回复</a></li>
                      <li class="user_libg_06"><a href="SettingReplyVideo.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_a">视频回复</a></li>
                      <li class="user_libg_05"><a href="SettingReplyLBS.aspx?MicroId=<%=Request["MicroId"].ToString() %>" class="user_list_h">LBS回复</a></li>
                  </ul>
              </div>
              
              </div>
         </div>
    
        </div>
        
    </div>
    </form>
</body>
</html>
